#include <stdio.h>
#include <string.h>

void* my_memcmp(const void* str1, const void* str2, size_t n)
{
	int i = 0;
	int j = 0;
	while(n--)
	{
		if (*((char*)str1) - *((char*)str2) > 0)
		{
			return 1;
		}
		else if (*((char*)str1) - *((char*)str2) < 0)
		{
			return -1;
		}
		else
		{
			(char*)str1 = (char*)str1 + 1;
			(char*)str2 = (char*)str2 + 1;
		}
		
	}
	
	return 0;
}



int main()
{
	char arr1[] = "abcdef";
	char arr2[] = "abcde";
	char arr3[] = "abceaaaa";
	char arr4[] = "abcdef";
	size_t num = 6;

	int n = my_memcmp(arr1, arr2, num);
	int n2 = my_memcmp(arr1, arr3, num);
	int n3 = my_memcmp(arr1, arr4, num);
	printf("%d\n", n);
	printf("%d\n", n2);
	printf("%d\n", n3);
}